# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=masscan-automation
pkgver=26.a170abc
pkgrel=3
groups=('blackarch' 'blackarch-automation')
pkgdesc='Masscan integrated with Shodan API.'
arch=('any')
url='https://github.com/trevordavenport/MasscanAutomation'
license=('custom:unknown')
depends=('python2' 'python2-beautifulsoup4' 'python2-shodan' 'python2-requests'
         'masscan')
makedepends=('git')
source=("$pkgname::git+https://github.com/trevordavenport/MasscanAutomation.git"
        "$pkgname.patch")
sha512sums=('SKIP'
            '98b2f0d7af26b2e5f4e881b58fd1eb371aea6d27c5eb31d3297abafc73f269dae7bf71af792f8d950a19f08742e14ff275f64a9a18602479a59423e87ab51dbc')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  patch -p2 < "../$pkgname.patch"
}

package() {
  cd $pkgname

  install -Dm 755 masscan_automation.py "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
}

